<template>
	<view class="content">
		<view class="bulding-info">
			<view class="title text-cut text-bold"><text v-if="options.source!=''&&options.source!=null">[{{options.source}}]</text>{{options.title}}</view>
			<view class="price text-bold"><text>{{options.money+(options.letway==1?"元/月":"")}} </text></view>
			<view class="addr text-blue flex" @tap="getLocation"> <text class="cuIcon-locationfill"></text>地址：{{options.address}}</view>
			<view class="publishDate text-gray flex">发布日期：{{options.createDateTime}}</view>
			
		</view>
	</view>
</template>


<script>
	export default {
		props: {
			options: {
				type: Object,
				default: function(e) {
					return {}
				}
			}
		},
		methods: {
			click() {
				this.$emit('click');
			},
			close(e) {
				this.$emit('close');
			},
			getLocation(){
				var data=this.options;
				uni.getLocation({
				    type: 'gcj02', //返回可以用于uni.openLocation的经纬度
				    success: function (res) {
				        uni.openLocation({
				            latitude: data.lat,
				            longitude: data.lng,
							name:data.address,
				            success: function () {
				                console.log('success');
				            }
				        });
				    }
				});
				
			},
		}
	}
</script>

<style lang="scss">
	.content{
		display: flex;
		flex-direction: row;
		border-bottom: #E1D7F0 1px solid;
		background: #FFFFFF;
		padding:5px;
		.image{
			width:40vw;
			image{
				width:40vw;
				height: 30vw;
			}
		}
		.bulding-info{
			margin-left: 15px;
			display: flex;
			flex-direction: column;
			view{
				padding: 2px 0;
			}
			.title{
				font-size: 26px;
			}
			.price{
				color:#ED1C24
			}
			.other{
				display:flex;
				flex-direction: row;
				.text-green{
					flex:1;
					text{
						padding: 4px;
						margin-left:4px;
						background:#DDDDDD;
						
					}
				}
				.text-right{
					display: flex;
					flex-direction: row;
					width:30px;
					font-size: 12px;
				    .icon{
						font-size:13px;
					}
				}
			}
		}
	}
</style>
